<html><head><meta http-equiv="content-type" content="text/html; charset=utf8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * Creates a new ToolBarView.
<span class='line'>  3</span>  * 
<span class='line'>  4</span>  * @constructor
<span class='line'>  5</span>  */</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="NAME">mindmaps.ToolBarView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  8</span> 
<span class='line'>  9</span> </span><span class="WHIT">	</span><span class="NAME">this.init</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> 
<span class='line'> 12</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 13</span> 	 * Adds a button to the toolbar with the given align function.
<span class='line'> 14</span> 	 * 
<span class='line'> 15</span> 	 * @param {mindmaps.ToolBarButton} button
<span class='line'> 16</span> 	 * @param {Function} alignFunc
<span class='line'> 17</span> 	 */</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT">	</span><span class="NAME">this.addButton</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">alignFunc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT">		</span><span class="COMM">// var $button = this.createButton(button);</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT">		</span><span class="NAME">alignFunc</span><span class="PUNC">(</span><span class="NAME">button.asJquery</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> 
<span class='line'> 23</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 24</span> 	 * Adds a set of buttons grouped together to the toolbar.
<span class='line'> 25</span> 	 * 
<span class='line'> 26</span> 	 * @param {mindmaps.ToolBarButton[]} buttons
<span class='line'> 27</span> 	 * @param {Function} alignFunc
<span class='line'> 28</span> 	 */</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">	</span><span class="NAME">this.addButtonGroup</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">buttons</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">alignFunc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$buttonset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;span/>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">		</span><span class="NAME">buttons.forEach</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">			</span><span class="COMM">// var $button = self.createButton(button);</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">			</span><span class="NAME">$buttonset.append</span><span class="PUNC">(</span><span class="NAME">button.asJquery</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">		</span><span class="NAME">$buttonset.buttonset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">		</span><span class="NAME">alignFunc</span><span class="PUNC">(</span><span class="NAME">$buttonset</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> 
<span class='line'> 39</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 40</span> 	 * Adds a menu to the toolbar.
<span class='line'> 41</span> 	 * 
<span class='line'> 42</span> 	 * @param {mindmaps.ToolBarMenu} menu
<span class='line'> 43</span> 	 */</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">	</span><span class="NAME">this.addMenu</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">menu</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">		</span><span class="NAME">this.alignRight</span><span class="PUNC">(</span><span class="NAME">menu.getContent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> 
<span class='line'> 48</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 49</span> 	 * Adds the element to the left side of the toolbar.
<span class='line'> 50</span> 	 * 
<span class='line'> 51</span> 	 * @param {jQuery} $el
<span class='line'> 52</span> 	 */</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">	</span><span class="NAME">this.alignLeft</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$el</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">		</span><span class="NAME">$el.appendTo</span><span class="PUNC">(</span><span class="STRN">"#toolbar .buttons-left"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> 
<span class='line'> 57</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 58</span> 	 * Adds the element to the right side of the toolbar.
<span class='line'> 59</span> 	 * 
<span class='line'> 60</span> 	 * @param {jQuery} $el
<span class='line'> 61</span> 	 */</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">	</span><span class="NAME">this.alignRight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$el</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">		</span><span class="NAME">$el.appendTo</span><span class="PUNC">(</span><span class="STRN">"#toolbar .buttons-right"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> 
<span class='line'> 67</span> </span><span class="COMM">/**
<span class='line'> 68</span>  * Toolbar button model.
<span class='line'> 69</span>  * 
<span class='line'> 70</span>  * @constructor
<span class='line'> 71</span>  * @param {mindmaps.Command} command
<span class='line'> 72</span>  */</span><span class="WHIT">
<span class='line'> 73</span> 
<span class='line'> 74</span> </span><span class="NAME">mindmaps.ToolBarButton</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">command</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">	</span><span class="NAME">this.command</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">command</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> 
<span class='line'> 77</span> </span><span class="WHIT">	</span><span class="COMM">// callback to update display state</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">	</span><span class="NAME">command.subscribe</span><span class="PUNC">(</span><span class="NAME">mindmaps.Command.Event.ENABLED_CHANGED</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">			</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">enabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.setEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">					</span><span class="NAME">self.setEnabled</span><span class="PUNC">(</span><span class="NAME">enabled</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> 
<span class='line'> 87</span> </span><span class="COMM">/**
<span class='line'> 88</span>  * Returns whether the button should have an enabled style.
<span class='line'> 89</span>  * 
<span class='line'> 90</span>  * @returns {Boolean}
<span class='line'> 91</span>  */</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="NAME">mindmaps.ToolBarButton.prototype.isEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.command.enabled</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span> 
<span class='line'> 96</span> </span><span class="COMM">/**
<span class='line'> 97</span>  * Executes the button's command.
<span class='line'> 98</span>  */</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="NAME">mindmaps.ToolBarButton.prototype.click</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">	</span><span class="NAME">this.command.execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> 
<span class='line'>103</span> </span><span class="COMM">/**
<span class='line'>104</span>  * Gets the button's title.
<span class='line'>105</span>  * 
<span class='line'>106</span>  * @returns {String}
<span class='line'>107</span>  */</span><span class="WHIT">
<span class='line'>108</span> </span><span class="NAME">mindmaps.ToolBarButton.prototype.getTitle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.command.label</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> 
<span class='line'>112</span> </span><span class="COMM">/**
<span class='line'>113</span>  * Gets the tooltip.
<span class='line'>114</span>  * 
<span class='line'>115</span>  * @returns {String}
<span class='line'>116</span>  */</span><span class="WHIT">
<span class='line'>117</span> </span><span class="NAME">mindmaps.ToolBarButton.prototype.getToolTip</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tooltip</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.command.description</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> 
<span class='line'>120</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">shortcut</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.command.shortcut</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">shortcut</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">		</span><span class="NAME">tooltip</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">shortcut.toUpperCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>124</span> 
<span class='line'>125</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">tooltip</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> 
<span class='line'>128</span> </span><span class="COMM">/**
<span class='line'>129</span>  * Gets the unique id of the button.
<span class='line'>130</span>  * 
<span class='line'>131</span>  * @returns {String}
<span class='line'>132</span>  */</span><span class="WHIT">
<span class='line'>133</span> </span><span class="NAME">mindmaps.ToolBarButton.prototype.getId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"button-"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.command.id</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> 
<span class='line'>137</span> </span><span class="COMM">/**
<span class='line'>138</span>  * Constructs a jQuery element that represents the button.
<span class='line'>139</span>  * 
<span class='line'>140</span>  * @returns {jQuery}
<span class='line'>141</span>  */</span><span class="WHIT">
<span class='line'>142</span> </span><span class="NAME">mindmaps.ToolBarButton.prototype.asJquery</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$button</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;button/>"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">		</span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getId</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">		</span><span class="NAME">title</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getToolTip</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">		</span><span class="NAME">self.click</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">button</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">		</span><span class="NAME">label</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getTitle</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">		</span><span class="NAME">disabled</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.isEnabled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> 
<span class='line'>154</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">icon</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.command.icon</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">icon</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">		</span><span class="NAME">$button.button</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">			</span><span class="NAME">icons</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT">				</span><span class="NAME">primary</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">icon</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>162</span> 
<span class='line'>163</span> </span><span class="WHIT">	</span><span class="COMM">// callback to update display state</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">	</span><span class="NAME">this.setEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">enabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">		</span><span class="NAME">$button.button</span><span class="PUNC">(</span><span class="NAME">enabled</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"enable"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"disable"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> 
<span class='line'>168</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">$button</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>169</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>170</span> 
<span class='line'>171</span> </span><span class="COMM">/**
<span class='line'>172</span>  * Creates a new ToolBarMenu.
<span class='line'>173</span>  * 
<span class='line'>174</span>  * @constructor
<span class='line'>175</span>  * @param {String} title
<span class='line'>176</span>  * @param {String} icon
<span class='line'>177</span>  */</span><span class="WHIT">
<span class='line'>178</span> </span><span class="NAME">mindmaps.ToolBarMenu</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">title</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">	</span><span class="NAME">this.$menuWrapper</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;span/>"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">		</span><span class="STRN">"class"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"menu-wrapper"</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> 
<span class='line'>184</span> </span><span class="WHIT">	</span><span class="NAME">this.$menuButton</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;button/>"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">button</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">		</span><span class="NAME">label</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">		</span><span class="NAME">icons</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">			</span><span class="NAME">primary</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">			</span><span class="NAME">secondary</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ui-icon-triangle-1-s"</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">this.$menuWrapper</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>191</span> 
<span class='line'>192</span> </span><span class="WHIT">	</span><span class="NAME">this.$menu</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;div/>"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">		</span><span class="STRN">"class"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"menu"</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">		</span><span class="COMM">/*
<span class='line'>196</span> 		 * hack to hide menu on click. visibility on hover is triggered by CSS.
<span class='line'>197</span> 		 * force display:none for a short time and remove class immediately
<span class='line'>198</span> 		 * again.
<span class='line'>199</span> 		 */</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">		</span><span class="NAME">self.$menu.addClass</span><span class="PUNC">(</span><span class="STRN">"hidden"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">		</span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">			</span><span class="NAME">self.$menu.removeClass</span><span class="PUNC">(</span><span class="STRN">"hidden"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">this.$menuWrapper</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>205</span> 
<span class='line'>206</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>207</span> 	 * Adds a new button entry to the menu.
<span class='line'>208</span> 	 * 
<span class='line'>209</span> 	 * @param {mindmaps.ToolBarButton|mindmaps.ToolBarButtons[]} buttons a
<span class='line'>210</span> 	 *            single button or an array of buttons
<span class='line'>211</span> 	 */</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">	</span><span class="NAME">this.add</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">buttons</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Array.isArray</span><span class="PUNC">(</span><span class="NAME">buttons</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">			</span><span class="NAME">buttons</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>216</span> 
<span class='line'>217</span> </span><span class="WHIT">		</span><span class="NAME">buttons.forEach</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$button</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">button.asJquery</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"ui-corner-all"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">					</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"menu-item"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">			</span><span class="NAME">this.$menu.append</span><span class="PUNC">(</span><span class="NAME">$button</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> 
<span class='line'>223</span> </span><span class="WHIT">		</span><span class="COMM">// last item gets rounded corners</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">		</span><span class="NAME">this.$menu.children</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">last</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"ui-corner-bottom"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">prev</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">				</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"ui-corner-bottom"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span> 
<span class='line'>228</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>229</span> 	 * Returns the underlying jquery object.
<span class='line'>230</span> 	 * 
<span class='line'>231</span> 	 * @returns {jQuery}
<span class='line'>232</span> 	 */</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">	</span><span class="NAME">this.getContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.$menuWrapper</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>236</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>237</span> 
<span class='line'>238</span> </span><span class="COMM">/**
<span class='line'>239</span>  * Creates a new ToolBarPresenter.
<span class='line'>240</span>  * 
<span class='line'>241</span>  * @constructor
<span class='line'>242</span>  * @param {mindmaps.EventBus} eventBus
<span class='line'>243</span>  * @param {mindmaps.CommandRegistry} commandRegistry
<span class='line'>244</span>  * @param {mindmaps.ToolBarView} view
<span class='line'>245</span>  * @param {mindmaps.MindMapModel} mindmapModel
<span class='line'>246</span>  */</span><span class="WHIT">
<span class='line'>247</span> </span><span class="NAME">mindmaps.ToolBarPresenter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eventBus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">commandRegistry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">view</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">		</span><span class="NAME">mindmapModel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>250</span> 	 * Returns a button that registers with a command of the given commandType
<span class='line'>251</span> 	 * 
<span class='line'>252</span> 	 * @param {mindmaps.Command} commandType
<span class='line'>253</span> 	 * @returns {mindmaps.ToolBarButton}
<span class='line'>254</span> 	 */</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">commandToButton</span><span class="PUNC">(</span><span class="NAME">commandType</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">command</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">commandRegistry.get</span><span class="PUNC">(</span><span class="NAME">commandType</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">mindmaps.ToolBarButton</span><span class="PUNC">(</span><span class="NAME">command</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>259</span> 
<span class='line'>260</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">commandsToButtons</span><span class="PUNC">(</span><span class="NAME">commands</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">commands.map</span><span class="PUNC">(</span><span class="NAME">commandToButton</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>263</span> 
<span class='line'>264</span> </span><span class="WHIT">	</span><span class="COMM">// populate toolbar</span><span class="WHIT">
<span class='line'>265</span> 
<span class='line'>266</span> </span><span class="WHIT">	</span><span class="COMM">// node buttons</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nodeCommands</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">mindmaps.CreateNodeCommand</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mindmaps.DeleteNodeCommand</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nodeButtons</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">commandsToButtons</span><span class="PUNC">(</span><span class="NAME">nodeCommands</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">	</span><span class="NAME">view.addButtonGroup</span><span class="PUNC">(</span><span class="NAME">nodeButtons</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">view.alignLeft</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> 
<span class='line'>271</span> </span><span class="WHIT">	</span><span class="COMM">// undo buttons</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">undoCommands</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">mindmaps.UndoCommand</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mindmaps.RedoCommand</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">undoButtons</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">commandsToButtons</span><span class="PUNC">(</span><span class="NAME">undoCommands</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">	</span><span class="NAME">view.addButtonGroup</span><span class="PUNC">(</span><span class="NAME">undoButtons</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">view.alignLeft</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> 
<span class='line'>276</span> </span><span class="WHIT">	</span><span class="COMM">// clipboard buttons.</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">clipboardCommands</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">mindmaps.CopyNodeCommand</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">			</span><span class="NAME">mindmaps.CutNodeCommand</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mindmaps.PasteNodeCommand</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">clipboardButtons</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">commandsToButtons</span><span class="PUNC">(</span><span class="NAME">clipboardCommands</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">	</span><span class="NAME">view.addButtonGroup</span><span class="PUNC">(</span><span class="NAME">clipboardButtons</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">view.alignLeft</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>281</span> 
<span class='line'>282</span> </span><span class="WHIT">	</span><span class="COMM">// file menu</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileMenu</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">mindmaps.ToolBarMenu</span><span class="PUNC">(</span><span class="STRN">"Mind map"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"ui-icon-document"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileCommands</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">mindmaps.NewDocumentCommand</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">			</span><span class="NAME">mindmaps.OpenDocumentCommand</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mindmaps.SaveDocumentCommand</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">			</span><span class="NAME">mindmaps.CloseDocumentCommand</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileButtons</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">commandsToButtons</span><span class="PUNC">(</span><span class="NAME">fileCommands</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">	</span><span class="NAME">fileMenu.add</span><span class="PUNC">(</span><span class="NAME">fileButtons</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">	</span><span class="NAME">view.addMenu</span><span class="PUNC">(</span><span class="NAME">fileMenu</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>290</span> 
<span class='line'>291</span> </span><span class="WHIT">	</span><span class="COMM">// help button</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">	</span><span class="NAME">view.addButton</span><span class="PUNC">(</span><span class="NAME">commandToButton</span><span class="PUNC">(</span><span class="NAME">mindmaps.HelpCommand</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">view.alignRight</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>293</span> 
<span class='line'>294</span> </span><span class="WHIT">	</span><span class="NAME">this.go</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">		</span><span class="NAME">view.init</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>297</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>